<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>valueog tostring</title>
</head>
<body>
    

    <script>
    
        {

            // 每个对象数据类型都有的三个方法 toString toLocalString valueOf

            // valueof 获得的是对象原始值
            // toString 变为字符串
            // tolocalstring 变为本地字符串

            let ary = [1,2,3];

            console.log(ary.valueOf());
            console.log(ary.toString());
            console.log(ary.toLocaleString());


            let obj = {
                name: 'ws',
                age: 10
            };

            obj.job = 'des';

            console.log(obj.valueOf());
            console.log(obj.toString());
            console.log(obj.toLocaleString());


        }
    
    </script>


</body>
</html>